<?php 
namespace Admin\Model;
use \Think\Model;

class UserModel extends Model
{
    protected $fields = array('id','name','sex','age');
    protected $pk = 'id';
    protected $_validate = array(
        // array(验证字段1,验证规则,错误提示,[验证条件,附加规则,验证时间]),
        array('name','', '用户名已存在!',0,'unique',1),
    );

}


